//index.js
//获取应用实例
const app = getApp()

Page({
  data:{
    userInfo: {}
  },
  onLoad: function () {
    if (app.globalData.userInfo) {
      this.setData({
        userInfo: app.globalData.userInfo
      })
    } else {
      // 在没有 open-type=getUserInfo 版本的兼容处理
      wx.getUserInfo({
        success: res => {
          app.globalData.userInfo = res.userInfo
          this.setData({
            userInfo: res.userInfo
          })
        }
      })
    }
  },
  navigateToAccountInfo: function (event){
    const openId = app.globalData.openId;
    const storageData = wx.getStorageSync(openId);
    const account=storageData.account;
    const params = JSON.stringify(account);
    wx.navigateTo({
      url: '/pages/account/account?account=' + params,
    });
  }
});